package org.jie.guider.framework.mybatis.mapper;

import java.io.IOException;
import java.io.Reader;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.jupiter.api.BeforeEach;

/**
 * @author LiJie
 */
public class SessionFactory {

    protected SqlSessionFactory sessionFactory;

    @BeforeEach
    public void before() throws IOException {
        String configFile = "mybatis-config-test.xml";
        Reader config = Resources.getResourceAsReader(configFile);
        sessionFactory = new SqlSessionFactoryBuilder().build(config);
    }
}
